import { App } from 'vue'

export default function (app: App) {
  app.config.globalProperties.$filter = (number: number) => {
    let s = number.toString()
    s += ''
    if (/\.\d$/.test(s)) s += '0'
    while (/\d{4}(|,)/.test(s))
      /**符合条件则进行替换**/
      s = s.replace(/(\d)(\d{3}(|,))/, '$1,$2')
    return s
  }
}
